import 'dart:convert';
import 'package:flutter_app/generated/json/base/json_field.dart';
import 'package:flutter_app/generated/json/article_detail_entity.g.dart';

@JsonSerializable()
class ArticleDetailEntity {
  String? articleType;
  String? content;
  String? contentType;
  String? contentTypeName;
  String? createBy;
  String? createByName;
  String? createTime;
  List<ArticleDetailFileList>? fileList;
  String? id;
  String? isRotation;
  String? isTop;
  String? publishBy;
  String? publishByName;
  String? publishTime;
  @JSONField(name: "source")
  String? xSource;
  String? state;
  String? summary;
  String? title;
  String? updateBy;
  String? updateByName;
  String? updateTime;

  ArticleDetailEntity();

  factory ArticleDetailEntity.fromJson(Map<String, dynamic> json) => $ArticleDetailEntityFromJson(json);

  Map<String, dynamic> toJson() => $ArticleDetailEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class ArticleDetailFileList {
  String? createTime;
  String? duration;
  String? fileSize;
  String? fileType;
  String? id;
  String? isRead;
  String? name;
  String? relationId;
  String? sourcePath;
  String? thumbnailPath;

  ArticleDetailFileList();

  factory ArticleDetailFileList.fromJson(Map<String, dynamic> json) =>
      $ArticleDetailFileListFromJson(json);

  Map<String, dynamic> toJson() => $ArticleDetailFileListToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}
